package util;

import entry.Ticket_open;
import pojo.XianShi;

import java.util.ArrayList;
import java.util.List;
@SuppressWarnings("all")
public class Page {

        private int pageIndex;
        private int pageSize;
        private long totalItems;  //表示查询结果中总共有多少条数据。这个值用来计算总页数以及判断是否还有更多页面的数据可以显示
        private ArrayList<XianShi> items;  //存储当前页的实际数据。这是一个 Ticket_open 类型的列表，其中包含了当前页的所有数据项

        public Page() {
        }

        public Page(int pageIndex, int pageSize, long totalItems, ArrayList<XianShi> items) {
            this.pageIndex = pageIndex;
            this.pageSize = pageSize;
            this.totalItems = totalItems;
            this.items = items;
        }

        public int getPageIndex() {
            return pageIndex;
        }

        public void setPageIndex(int pageIndex) {
            this.pageIndex = pageIndex;
        }

        public int getPageSize() {
            return pageSize;
        }

        public void setPageSize(int pageSize) {
            this.pageSize = pageSize;
        }

        public long getTotalItems() {
            return totalItems;
        }

        public void setTotalItems(long totalItems) {
            this.totalItems = totalItems;
        }

        public ArrayList<XianShi>getItems() {
            return items;
        }

        public void setItems(ArrayList<XianShi> items) {
            this.items = items;
        }

        @Override
        public String toString() {
            return "Page{" +
                    "pageIndex=" + pageIndex +
                    ", pageSize=" + pageSize +
                    ", totalItems=" + totalItems +
                    ", items=" + items +
                    '}';
        }
    }
